function fib(n: number): number {
    if (n === 0) {
        return 0
    }

    if (n === 1) {
        return 1
    }

    let res = [0, 1];
    let i = 2;
    while (i <= n) {
        const x = (res[i - 2] + res[i - 1]) % 1000000007;
        res.push(x);
        i++;
    }
    return res[res.length - 1];
};

fib(81)